package com.onec.service.netty.coder;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import io.netty.handler.codec.MessageToByteEncoder;
import java.util.List;

/**
 * 加密器的 使用
 */
public class IntegerByteEncoder extends MessageToByteEncoder<Integer> {


  @Override
  protected void encode(ChannelHandlerContext ctx, Integer msg, ByteBuf out) throws Exception {
    out.writeInt(msg);
    System.out.println("xxxxx" + msg);
  }
}
